package cn.itcast.nems.order.web.controller.b;

import cn.itcast.nems.order.service.OrderCustomerRelationshipService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * 销售订单-客户关系
 */
@Slf4j
@RestController("bOrderCustomerRelationshipController")
@RequestMapping("/b/order/customer")
public class OrderCustomerRelationshipController {
    @Autowired
    private OrderCustomerRelationshipService orderCustomerRelationshipService;

    /**
     * 通过客户名获取客户列表
     * @param customerName
     * @return
     */
    @GetMapping("/names")
    public ResponseEntity<?> orderCustomerRelationships(@RequestParam String customerName) {
        return ResponseEntity.ok(orderCustomerRelationshipService.orderCustomerRelationships(customerName));
    }

}
